gusucode.com > 渝海网站收录查询工具 1 > 渝海网站收录查询工具 1.5/code/config.php

    <?php
/*
渝海软件[HaiPHP.COM]
*/
require 'smarty/libs/Smarty.class.php';
require 'Textclass.php';
$smarty = new Smarty;
$smarty->template_dir = "templates"; //模板文件目录
$smarty->compile_dir = "smarty/templates/templates_c";
$smarty->config_dir = "smarty/templates/config";
$smarty->cache_dir = "smarty/templates/cache";
$smarty->caching = false;

function _link($url){
	$ch = curl_init();
	$timeout = 5;
	curl_setopt ($ch, CURLOPT_URL, "$url");
	curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
	curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	$contents = curl_exec($ch);
	curl_close($ch);
	if($contents=="Forbidden"||empty($contents)){
		$contents = @file_get_contents("$url");
	}
	if(empty($contents)){
		exit('<font color=red>不能正常访问.</font>');
	}
	return $contents;
}
?>